module.exports.exitLogin = function() {
  localStorage.clear();
  sessionStorage.clear();
  location.href = "newLogin.html";
};

module.exports.getUserInfo = function(axios) {
  return new Promise((resolve, reject) => {
    axios.get("/user/getUserInfo").then((res) => {
      if (res.success) {
        resolve(res);
      } else {
        reject(res.msg);
      }
    });
  });
};

module.exports.checkUserInfo = function(axios) {
  return new Promise((resolve, reject) => {
    axios.get("/login/checkBox").then((res) => {
      if (res.success) {
        resolve(res);
      } else {
        reject(res.msg);
      }
    });
  });
};
